package org.java.path;

import java.io.InputStream;

/**
 * Java 路径测试
 * Created by Administrator on 2016/12/8.
 */
public class PathTest {

    public static void main(String[] args) {
        // 获取Java 项目根目录
        String rootPath = System.getProperty("user.dir");
        System.out.println(rootPath);

        // 当前的classpath的绝对URI路径
        String classpath = new PathTest().getClass().getResource("/").getPath();
        System.out.println(classpath.substring(1, classpath.length()));
    }
}
